<html>
<head>
  <title>AngularJS Controller</title>
</head>
<body>
  <h1>Sample Application</h1>
  <div ng-app="mainApp" ng-controller="studentController">
    <p>Enter first name: <input type="text" ng-model="student.firstName" ></p>
    <p>Enter last name: <input type="text" ng-model="student.lastName" ></p>
    <p>You are entering: {{student.fullName()}}</p>
  </div>
  <script src="js/angular.min.js"></script>
  <script>
    angular.module('mainApp', [])
    .controller('studentController', function($scope){
      $scope.student = {
        firstName: 'Mahesh',
        lastName: 'Parashar',
        
        fullName: function(){
          var studentObject = $scope.student;
          return studentObject.firstName + ' ' + studentObject.lastName;
        }
      };
    });
  </script>
</body>
</html>